﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="qst_manage_log.aspx.cs" Inherits="Ccit.OA.Question.qst_manage_log" %>
<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>问卷管理-问卷答复记录页面</title>
     <script language="javascript" type="text/javascript" src="../script/jwindow.js"></script>
    <script language="javascript" type="text/javascript" src="../script/jsonlib.js"></script>
    <script language="javascript" src="../script/jquery.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jcontrol.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="../script/jbase64.js"></script>
     <script language="javascript" type="text/javascript">
            var tabPageArray = [];
            var tabTitleArray = [];
            
            function doChangeTab(tabSign){
                
                var curSelTabSign = document.getElementById("_hidSelTab").value;
                
                if(tabPageArray.length == 0) {
                    initTabPageArray();
                    initTabTitleArray();
                }
                
                // set new select tab style
                setTabSelected(tabSign);
                
                // restore origin tab style
                setTabUnSel(curSelTabSign);
                
                document.getElementById("_hidSelTab").value = tabSign; 
                
                self.window.frames[0].document.location.href = findInfo(tabSign,tabPageArray);
            }
            
            function initTabPageArray() {
                var liItem;
                var type = document.getElementById("ddlStaue").value; 
                var vQId = document.getElementById("_hidQId").value;
                var organPageParam="qId="+vQId+"&pageFlag=2&type="+type;    //用户
                var organEncodeParam=base64encode(organPageParam);
                liItem = new ListItem("user","./qst_manage_usersel.aspx?"+organEncodeParam);
                tabPageArray.push(liItem);
                
            
                
                var recentPageParam="qId="+vQId+"&pageFlag=1&type="+type;    //部门

                var recentEncodeParam=base64encode(recentPageParam);
                liItem = new ListItem("dept","./qst_manage_usersel.aspx?"+recentEncodeParam);
                tabPageArray.push(liItem);
            }
            
            function initTabTitleArray() {
                var liItem;
                liItem = new ListItem("user","人员");
                tabTitleArray.push(liItem);
                
                liItem = new ListItem("dept","部门");
                tabTitleArray.push(liItem); 
             
            }
            
            function findInfo(tabSign,tabInfoArray) {
                var itemCount = tabInfoArray.length;
                var liItem;
                var retInfo = "";
                for(var i = 0; i < itemCount; i ++) {
                    liItem = tabInfoArray[i];
                    if(liItem.Text == tabSign) {
                        retInfo = liItem.Value;
                        break;
                    }
                }
                return retInfo;
            }
            /* 页签选中 */
            function setTabSelected(tabSign) {
                 
                var leftImgId = "ast_left_" + tabSign;
                var rightImgId = "ast_right_" + tabSign;                
                var ctrlTab = document.getElementById(tabSign);
                var aId = "a" + tabSign;
                var aCtrl = document.getElementById(aId);
                
                document.getElementById(leftImgId).src = "../images/pagetab_h_left.gif";
                ctrlTab.background = "../images/pagetab_bg_high.gif";
                ctrlTab.className = "PageTabRangeSelect";                
                aCtrl.innerHTML = "<B>" + findInfo(tabSign,tabTitleArray) + "</B>";
                aCtrl.className = "linktext";
                document.getElementById(rightImgId).src = "../images/pagetab_h_right.gif";
            }
            /* 页签未选中 */
            function setTabUnSel(tabSign){
                var leftImgId = "ast_left_" + tabSign;
                var rightImgId = "ast_right_" + tabSign;
                var ctrlTab = document.getElementById(tabSign);
                var aId = "a" + tabSign;
                var aCtrl = document.getElementById(aId);
                
                document.getElementById(leftImgId).src = "../images/pagetab_l_left.gif";
                ctrlTab.background = "../images/pagetab_bg_low.gif";
                ctrlTab.className = "PageTabRange";
                aCtrl.innerHTML = findInfo(tabSign,tabTitleArray);
                aCtrl.className = "linktabtext";
                document.getElementById(rightImgId).src = "../images/pagetab_l_right.gif";
            }
            function doSend()
            {
                var userIds = window.frames[0].GetcheckUserIds();
                var userArr = userIds.split(",");
                var oStrResult="";
                for(var i=0;i<userArr.length;i++)
                {
                    var oUser=userArr[i];
                    var ostr=oUser.split("_");
                    if(ostr[2]!="dept"||ostr[1]!="1")
                        oStrResult+=(oStrResult=="") ? ostr[0] : ","+ostr[0];
                }
                document.getElementById("_hidUserId").value = oStrResult;
                //alert(oStrResult);
            }
            function doSearch()
            {
//                var type = document.getElementById("ddlStaue").value; 
//                self.window.frames[0].GetSearch(type); 

                 var type = document.getElementById("ddlStaue").value; 
                 var tabSign = document.getElementById("_hidSelTab").value;
                 var qId = document.getElementById("_hidQId").value;
                 tabSign = (tabSign == "user") ? "2" : "1";
                 var strURL = "./qst_manage_usersel.aspx?";
                 var vPageParam = "type=" + type + "&qId=" + qId + "&pageFlag=" + tabSign;
                 var encodeParam = base64encode(vPageParam);
                 $get("iFrmView").src = strURL + encodeParam;
            }
            function PrintPage()
	        {
		        document.getElementById("TablePrint").style.visibility = "hidden";
		        window.print();
		        document.getElementById("TablePrint").style.visibility = "visible";
	        }
	    
	        /*  Close Window  */
	        function Close()
	        {
	            window.close();
	        }	    
	        function doRemind()
	        {
	            var qId = document.getElementById("_hidQId").value;
	            if(qId!="")
	            {
	                PageMethods.DoRemind(qId,ClientCallBack); 
	            }
	        }
	        function ClientCallBack(vResult)
	        {
	           // alert(vResult);
	        }
        </script>
     <script language="vbscript" type="text/vbscript">
	        <!--
		        function printsetup()	
		        ' 打印页面设置
			        call document.getElementById("wb").execwb(8,1)
		        end function
	        //-->
	 </script>
	
</head>
<body>
    <ccit:ActionForm id="form2" runat="server">
        <input type="hidden" id="_hidSelTab" runat="server" />
        <input type="hidden" id="_hidUserId" runat="server" />
        <input type="hidden" id="_hidQId" runat="server" />
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods=true>
        </asp:ScriptManager>
        <table cellpadding="0" cellspacing="0" width="100%" height="99%" border="0" align="center">
            <tr>
                <td colspan="2">
                    <table class="tbToolbar" cellpadding="0" cellspacing="0" width="100%" align="center" id="TablePrint">
                        <tr>
                            <td align="left">
                                <div class="tbSeparator"></div>
                            </td>
                            <td width="100%" class="titlebar">  
                                问卷管理-问卷答复记录页面
                            </td>                
                            <td align="right">
                                <nobr>
                                    状态:<asp:DropDownList ID="ddlStaue" CssClass="inputselect" Width="100" runat="server">
                                    <asp:ListItem Value="" Selected>全部</asp:ListItem>
                                    <asp:ListItem Value="0">已答</asp:ListItem>
                                    <asp:ListItem Value="1">未答</asp:ListItem>
                                </asp:DropDownList> 
                                    &nbsp; <a  id="lnbSearch" Runat="server" class="linktext"  href="javascript:doSearch()">
                                        <img src="../images/toolbar/search.gif" />查询
                                    </a> 
                                     <a  id="A1" Runat="server" class="linktext"  href="javascript:doRemind()">
                                        <img src="../images/toolbar/Displace.gif" />提醒
                                     </a>
                                    
                                    <a  id="lnbAdd" Runat="server" class="linktext" href="javascript:PrintPage()">
					                    <img src="../images/toolbar/new.gif" border="0">打印
				                    </a>
				                     <a  id="lnbDel" Runat="server" class="linktext"  href="javascript:Close()">
					                    <img src="../images/toolbar/Delete.gif" border="0">关闭
				                    </a>
                                 </nobr>
                            </td> 
                        </tr>
                </table>
                </td>
            </tr> 
            <tr>
            <td></td>
            </tr>   
            <tr>
                <td style="width:28%;  height:98%;" align="center">
                    <table cellpadding="0" cellspacing="0" width="98%" align="right" height="98%" border="0">
                          <tr>
                             <td align="center">
                                   <table cellpadding="0" cellspacing="0" width="100%" align="right">
                                        <tr>
                                            <td width="1"><img src="../images/pagetab_h_left.gif" id="ast_left_user" border="0" /></td>   
                                            <td width="80" align="center" background="../images/pagetab_bg_high.gif" id="user" class="PageTabRangeSelect">
                                                <nobr>&nbsp;<a id="auser" class="linktext" href="javascript:doChangeTab('user')"><strong>人员</strong>&nbsp;</a></nobr>
                                            </td>
                                            <td width="1"><img src="../images/pagetab_h_right.gif"  id="ast_right_user" /></td> 
                                            <td width='1'><img src='../images/pagetab_l_left.gif'  id='ast_left_dept' border="0" /></td>
                                            <td width='80'  align='center' background='../images/pagetab_bg_low.gif' id='dept' class='PageTabRange'>
                                                <nobr>&nbsp;<a id="adept" href="javascript:doChangeTab('dept');" class='linktabtext'>部门</a>&nbsp;</nobr>
                                            </td>
                                            <td width='1'><img src='../images/pagetab_l_right.gif'  id='ast_right_dept' border="0" /></td>  
                                            <td background='./images/pagetab_bg.gif'>&nbsp;</td>        
                                       </tr>      
                                   </table>
                                </td>
                          </tr> 
                         <tr>		
                            <td align="right">
                                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CECECE"	height="3">	
                                    <tr>
                                        <td width="100%">
                                            <div id="toolbar_text"></div>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr> 
                        <tr>
                            <td valign="top"  width="99%" align="center" style="border-right:#CDCECF 1px solid;border-left:#CDCECF 1px solid;border-bottom:#CDCECF 1px solid;border-top:#D9D9DA 0px solid;height:100%">                    
                                <iframe id="iFrmView" name="iFrmView" height="99%" width="100%" scrolling="auto" frameborder="0" >
                                </iframe>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="100%" height="100%" valign="top" align="center">
                            <iframe id="iFrmEdit" name="iFrmEdit" height="100%" width="100%" scrolling="auto" frameborder="0"
                               src="">
                            </iframe> 
                </td>
            </tr>      
    </table>
    </ccit:ActionForm>
    <script type="text/javascript">
    <!--
        $(document).ready(function(){
        
            var curSelTabSign = document.getElementById("_hidSelTab").value;
           
            if(tabPageArray.length == 0) {
                initTabPageArray();
                initTabTitleArray();
            }
            
            // set new select tab style
            setTabSelected(curSelTabSign);
            
            if(curSelTabSign != "user")
                setTabUnSel("user");
            
            var strURL = findInfo(curSelTabSign,tabPageArray)  
            self.window.frames[0].document.location.href= strURL;
//            var vQId = document.getElementById("_hidQId").value;
//            
//            var userId = window.frames[0].document.getElementById("_hidCheckUserId").value;
//            var organEncodeParam=base64encode(organPageParam);
//            var organPageParam="qId="+vQId+"&userId="+userId;    //问卷ID 和用户ID
//            var URL = "qst_manage_logView.aspx?"+organEncodeParam;
//            self.window.frames["iFrmEdit"].document.location.href= URL;
        });
        
    //-->
    </script>
    </body>
</html>
